package maosui.model;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by wdj on 14-8-10.
 */
@Entity
@Table(name = "51lpz_users")
public class UserEntity {
    private int id;
    private String username;
    private String useremail;
    private String userpwd;
    private int points;
    private int pointsLose;
    private int logins;
    private String lastloginip;
    private Timestamp lastlogintime;
    private int userType;
    private String guide;
    private String userinvitation;
    private String xinlangid;
    private String tengxunid;
    private Timestamp inserttime;

    @Id
    @Column(name = "userid", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int userid) {
        this.id = userid;
    }

    @Basic
    @Column(name = "username", nullable = false, insertable = true, updatable = true, length = 50)
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "useremail", nullable = false, insertable = true, updatable = true, length = 50)
    public String getUseremail() {
        return useremail;
    }

    public void setUseremail(String useremail) {
        this.useremail = useremail;
    }

    @Basic
    @Column(name = "userpwd", nullable = false, insertable = true, updatable = true, length = 150)
    public String getUserpwd() {
        return userpwd;
    }

    public void setUserpwd(String userpwd) {
        this.userpwd = userpwd;
    }

    @Basic
    @Column(name = "points", nullable = false, insertable = true, updatable = true)
    public int getPoints() {
        return points;
    }

    public void setPoints(int points) {
        this.points = points;
    }

    @Basic
    @Column(name = "points_lose", nullable = false, insertable = true, updatable = true)
    public int getPointsLose() {
        return pointsLose;
    }

    public void setPointsLose(int pointsLose) {
        this.pointsLose = pointsLose;
    }

    @Basic
    @Column(name = "logins", nullable = false, insertable = true, updatable = true)
    public int getLogins() {
        return logins;
    }

    public void setLogins(int logins) {
        this.logins = logins;
    }

    @Basic
    @Column(name = "lastloginip", nullable = false, insertable = true, updatable = true, length = 15)
    public String getLastloginip() {
        return lastloginip;
    }

    public void setLastloginip(String lastloginip) {
        this.lastloginip = lastloginip;
    }

    @Basic
    @Column(name = "lastlogintime", nullable = false, insertable = true, updatable = true)
    public Timestamp getLastlogintime() {
        return lastlogintime;
    }

    public void setLastlogintime(Timestamp lastlogintime) {
        this.lastlogintime = lastlogintime;
    }

    @Basic
    @Column(name = "usertype", nullable = false, insertable = true, updatable = true)
    public int getUserType() {
        return userType;
    }

    public void setUserType(int usertype) {
        this.userType = usertype;
    }

    @Basic
    @Column(name = "guide", nullable = false, insertable = true, updatable = true, length = 10)
    public String getGuide() {
        return guide;
    }

    public void setGuide(String guide) {
        this.guide = guide;
    }

    @Basic
    @Column(name = "userinvitation", nullable = false, insertable = true, updatable = true, length = 26)
    public String getUserinvitation() {
        return userinvitation;
    }

    public void setUserinvitation(String userinvitation) {
        this.userinvitation = userinvitation;
    }

    @Basic
    @Column(name = "xinlangid", nullable = false, insertable = true, updatable = true, length = 100)
    public String getXinlangid() {
        return xinlangid;
    }

    public void setXinlangid(String xinlangid) {
        this.xinlangid = xinlangid;
    }

    @Basic
    @Column(name = "tengxunid", nullable = false, insertable = true, updatable = true, length = 100)
    public String getTengxunid() {
        return tengxunid;
    }

    public void setTengxunid(String tengxunid) {
        this.tengxunid = tengxunid;
    }

    @Basic
    @Column(name = "inserttime", nullable = false, insertable = true, updatable = true)
    public Timestamp getInserttime() {
        return inserttime;
    }

    public void setInserttime(Timestamp inserttime) {
        this.inserttime = inserttime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserEntity that = (UserEntity) o;

        if (logins != that.logins) return false;
        if (points != that.points) return false;
        if (pointsLose != that.pointsLose) return false;
        if (id != that.id) return false;
        if (userType != that.userType) return false;
        if (guide != null ? !guide.equals(that.guide) : that.guide != null) return false;
        if (inserttime != null ? !inserttime.equals(that.inserttime) : that.inserttime != null) return false;
        if (lastloginip != null ? !lastloginip.equals(that.lastloginip) : that.lastloginip != null) return false;
        if (lastlogintime != null ? !lastlogintime.equals(that.lastlogintime) : that.lastlogintime != null)
            return false;
        if (tengxunid != null ? !tengxunid.equals(that.tengxunid) : that.tengxunid != null) return false;
        if (useremail != null ? !useremail.equals(that.useremail) : that.useremail != null) return false;
        if (userinvitation != null ? !userinvitation.equals(that.userinvitation) : that.userinvitation != null)
            return false;
        if (username != null ? !username.equals(that.username) : that.username != null) return false;
        if (userpwd != null ? !userpwd.equals(that.userpwd) : that.userpwd != null) return false;
        if (xinlangid != null ? !xinlangid.equals(that.xinlangid) : that.xinlangid != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (username != null ? username.hashCode() : 0);
        result = 31 * result + (useremail != null ? useremail.hashCode() : 0);
        result = 31 * result + (userpwd != null ? userpwd.hashCode() : 0);
        result = 31 * result + points;
        result = 31 * result + pointsLose;
        result = 31 * result + logins;
        result = 31 * result + (lastloginip != null ? lastloginip.hashCode() : 0);
        result = 31 * result + (lastlogintime != null ? lastlogintime.hashCode() : 0);
        result = 31 * result + userType;
        result = 31 * result + (guide != null ? guide.hashCode() : 0);
        result = 31 * result + (userinvitation != null ? userinvitation.hashCode() : 0);
        result = 31 * result + (xinlangid != null ? xinlangid.hashCode() : 0);
        result = 31 * result + (tengxunid != null ? tengxunid.hashCode() : 0);
        result = 31 * result + (inserttime != null ? inserttime.hashCode() : 0);
        return result;
    }
}
